<!--通过.css方法设置的样式属性优先级要高于.addClass方法-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS(addclass)</title>
    <script src="../jquery-3.4.1.js"></script>
    <style>
        .left,
        .right {
            width: 300px;
            height: 120px;
        }
        .left div,
        .right div {
            width: 200px;
            height: 90px;
            padding: 5px;
            margin: 5px;
            float: left;
        }
        a{
            font-size: 14px;
            display:block;
        }
        .newClass{
            background: #bbffaa;
        }
        .imoocClass{
            background: red;
        }
        .addBorder{
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <h2>.addClass()与.css()方法区别</h2>
    <div class="left">
        <div class="aaron">
            <a>css优先级高于addClass</a>
            <a>1：第一次addClass背景色</a>
            <a>2：第二次css修改背景色</a>
        </div>
    </div>
    <div class="right">
        <div class="aa bb imooc">
            <article>
                <a>imoocClass</a>
            </article>
        </div>
    </div>
</body>
<script>
    // $('div').addClass("addBorder");
    $('.aaron').addClass('newClass');
    $('.aaron').css("background","yellow");
</script>
</html>